<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">

    <title>MOOC oriented Data Analysis System - Exercise</title>
    <meta content="" name="descriptison">
    <meta content="" name="keywords">


    <!-- 引入刚刚下载的 ECharts 文件 -->
    <script src="static/assets/js/echarts.min.js"></script>

    <!-- 引入element-ui样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>

    <!-- Favicons -->
    <link href="static/assets/img/favicon.png" rel="icon">
    <link href="static/assets/img/apple-touch-icon.png" rel="apple-touch-icon">

    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i,900"
          rel="stylesheet">

    <!-- Vendor CSS Files -->
    <link href="static/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="static/assets/vendor/icofont/icofont.min.css" rel="stylesheet">
    <link href="static/assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
    <link href="static/assets/vendor/animate.css/animate.min.css" rel="stylesheet">
    <link href="static/assets/vendor/venobox/venobox.css" rel="stylesheet">
    <link href="static/assets/vendor/aos/aos.css" rel="stylesheet">

    <!-- Template Main CSS File -->
    <link href="static/assets/css/style.css" rel="stylesheet">

    <!-- =======================================================
    * Template Name: Mamba - v2.0.1
    * Template URL: https://bootstrapmade.com/mamba-one-page-bootstrap-template-free/
    * Author: BootstrapMade.com
    * License: https://bootstrapmade.com/license/
    ======================================================== -->
</head>

<body>
<!-- ======= Header ======= -->
<header id="header">
    <div class="container">

        <div class="logo float-left">
            <h1 class="text-light"><a href="index.html"><span>MOOC</span></a></h1>
            <!-- Uncomment below if you prefer to use an image logo -->
            <!-- <a href="index.html"><img src="static/assets/img/logo.png" alt="" class="img-fluid"></a>-->
        </div>

        <nav class="nav-menu float-right d-none d-lg-block">
            <ul>
                <li><a href="/index" style="font-size: 24px">首页</a></li>
                <li class="active"><a href="/exercise" style="font-size: 24px">练习</a></li>
                <li><a href="/problemlogs" style="font-size: 24px">日志</a></li>
                <li><a href="/recommend" style="font-size: 24px">应用</a></li>
            </ul>
        </nav><!-- .nav-menu -->

    </div>
</header><!-- End Header -->

<!-- ======= Our Team Section ======= -->
<section id="team" class="team">

    <div class="container">

        <div class="section-title">
            <h2>exercise基本信息</h2>
        </div>

        <section class="counts section-bg">
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div>
                <span style="font-size: 18px" class="font-color">领域信息</span> <span class="font-color">饼图，显示exercise所属的各个area的比例</span>
                <button id="btn1" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation1" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">
                        说明：从下图中我们可以知道一共有8个练习领域，并得出arithmetic、algebra、geometry为三个最主要的练习领域，练习数量约占85%，其中arithmetic领域的练习数量最多，达个301。</p>
                </div>
            </div>
            <div id="main" style="width: 100%;height:400px;"></div>

        </section>

        <section class="counts section-bg">
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div id="exercise_area_count" style="width: 100%;height:400px;margin-top: 10px"></div>

        </section>

        <section class="counts section-bg">
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div>
                <span style="font-size: 18px" class="font-color">话题信息</span> <span class="font-color">饼图，显示exercise所属的各个topic的比例</span>
                <button id="btn2" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation2" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">说明：从下图中我们可以知道一共有40个练习话题，主要集中在
                        fractions、solving-linear-equations-and-inequalities、decimals
                        、basic-geometry四个话题，其中fractions话题练习数量最多，达57个。</p>
                </div>
            </div>
            <div id="main2" style="width: 100%;height:400px;margin-top: 10px"></div>

        </section>

        <section class="counts section-bg">
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div id="exercise_topic_count" style="width: 100%;height:400px;margin-top: 10px"></div>

        </section>

        <section class="counts section-bg">
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div>
                <span style="font-size: 18px" class="font-color">存活信息</span> <span class="font-color">饼图，显示exercise的live和not live的比例</span>
                <button id="btn3" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation3" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">说明：可以看到超过90%习题仍存活着，也就是在题库中可以被学生拿来练习，此次分析结果有意义。</p>
                </div>
            </div>
            <div id="main3" style="width: 100%;height:400px;margin-top: 10px"></div>

        </section>

        <section class="counts section-bg">
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div>
                <span style="font-size: 18px" class="font-color">先决条件信息</span> <span class="font-color">饼图，显示exercise的前驱即prerequisites的比例</span>
                <button id="btn4" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation4" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">说明：从下图可知，练习的先决条件总数为531，主要集中在congruent_triangles_2、linear equations_3
                        、angles_2 、segment
                        addition四个练习，其中congruent_triangles_2最多，是10道练习的前提。</p>
                </div>
            </div>
            <div id="main4" style="width: 100%;height:400px;margin-top: 10px"></div>

        </section>

        <section class="counts section-bg">
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div id="exercise_prerequisites_count" style="width: 100%;height:400px;margin-top: 10px"></div>

        </section>

        <section class="counts section-bg">
            <div>
                <span style="font-size: 18px" class="font-color">知识图谱</span> <span
                    class="font-color">展示了知识图谱上练习按领域的分布情况</span>
                <button id="btn5" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation5" style="width: 300px;margin-left: 700px;position:absolute;right:20px;z-index: 1"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">
                        说明：通过h_position和v_position可以确定一道练习，练习在知识图谱中的位置是唯一的，下图展示了知识图谱上练习按领域和主题的分布情况。</p>
                </div>
            </div>
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div id="exercise_distribution_by_area" style="width: 100%;height:600px;margin-top: 10px"></div>

        </section>

        <section class="counts section-bg">
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <span style="font-size: 18px" class="font-color">知识图谱</span> <span
                class="font-color">展示了知识图谱上练习按话题的分布情况</span>
            <div id="exercise_distribution_by_topic" style="width: 100%;height:800px;margin-top: 10px"></div>

        </section>
    </div>

</section><!-- End Our Team Section -->

<!-- ======= Footer ======= -->
<footer id="footer">
    <div class="container">
        <div class="copyright">
            &copy; Copyright <strong><span>MOOC</span></strong>. All Rights Reserved
        </div>
        <div class="credits">
            <!-- All the links in the footer should remain intact. -->
            <!-- You can delete the links only if you purchased the pro version. -->
            <!-- Licensing information: https://bootstrapmade.com/license/ -->
            <!-- Purchase the pro version with working PHP/AJAX contact form: https://bootstrapmade.com/mamba-one-page-bootstrap-template-free/ -->
            Designed by <a href="https://bootstrapmade.com/">BootstrapMade</a>
        </div>
    </div>
</footer><!-- End Footer -->

<a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>

<!-- Vendor JS Files -->
<script src="static/assets/vendor/jquery/jquery.min.js"></script>
<script src="static/assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="static/assets/vendor/jquery.easing/jquery.easing.min.js"></script>
<script src="static/assets/vendor/php-email-form/validate.js"></script>
<script src="static/assets/vendor/jquery-sticky/jquery.sticky.js"></script>
<script src="static/assets/vendor/venobox/venobox.min.js"></script>
<script src="static/assets/vendor/waypoints/jquery.waypoints.min.js"></script>
<script src="static/assets/vendor/counterup/counterup.min.js"></script>
<script src="static/assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="static/assets/vendor/aos/aos.js"></script>
<script src="http://cdn.highcharts.com.cn/highcharts/highcharts.js"></script>
<!-- Template Main JS File -->
<script src="static/assets/js/main.js"></script>

<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));
    var myChart2 = echarts.init(document.getElementById('main2'));
    var myChart3 = echarts.init(document.getElementById('main3'));
    var myChart4 = echarts.init(document.getElementById('main4'));
    var myChart5 = echarts.init(document.getElementById('exercise_topic_count'));
    var myChart6 = echarts.init(document.getElementById('exercise_area_count'));
    var myChart7 = echarts.init(document.getElementById('exercise_prerequisites_count'));

    // 指定图表的配置项和数据
    option = {
        color: [
            '#ca8622',
            '#61a0a8',
            '#d48265',
            '#91c7ae',
            '#749f83',
            '#bda29a',
            '#6e7074',
            '#546570',
            '#c4ccd3'],
        title: {
            subtext: '所属领域',
            left: 'center'
        },
        tooltip: {
            trigger: 'item'
        },
        legend: {
            orient: 'vertical',
            left: 'left'
        },
        series: [
            {
                name: '所属领域',
                type: 'pie',
                radius: '50%',
                data:{{ area_count|tojson }},
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    option2 = {
        color: [
            '#ca8622',
            '#61a0a8',
            '#d48265',
            '#91c7ae',
            '#749f83',
            '#bda29a',
            '#6e7074',
            '#546570',
            '#c4ccd3'],
        title: {
            subtext: '所属话题',
            left: 'center'
        },
        tooltip: {
            trigger: 'item'
        },
        legend: {
            orient: 'vertical',
            left: 'left'
        },
        series: [
            {
                name: '所属话题',
                type: 'pie',
                radius: '50%',
                data:{{ topic_count|tojson }},
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    option3 = {
        color: [
            '#ca8622',
            '#61a0a8',
            '#d48265',
            '#91c7ae',
            '#749f83',
            '#bda29a',
            '#6e7074',
            '#546570',
            '#c4ccd3'],
        title: {
            subtext: '是否在题库中',
            left: 'center'
        },
        tooltip: {
            trigger: 'item'
        },
        legend: {
            orient: 'vertical',
            left: 'left'
        },
        series: [
            {
                name: '是否在题库中',
                type: 'pie',
                radius: '50%',
                data:{{ live_count|tojson }},
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    option4 = {
        color: [
            '#ca8622',
            '#61a0a8',
            '#d48265',
            '#91c7ae',
            '#749f83',
            '#bda29a',
            '#6e7074',
            '#546570',
            '#c4ccd3'],
        title: {
            subtext: '先决条件',
            left: 'center'
        },
        tooltip: {
            trigger: 'item'
        },
        legend: {
            orient: 'vertical',
            left: 'left'
        },
        series: [
            {
                name: '先决条件',
                type: 'pie',
                radius: '50%',
                data:{{ prerequisites_count|tojson }},
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    option5 = {
        color: ['#636EFA'],
        title: {
            text: '各话题练习数量统计',
            textStyle: {
                color: '#5C768D',
                fontSize: 18,
                fontWeight: 400
            },
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {},
        grid: {
            left: '3%',
            right: '7%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            name: 'count',
            type: 'value',
            boundaryGap: [0, 0.01]
        },
        yAxis: {
            name: 'topic',
            type: 'category',
            data: {{ exercise_topic_index|safe }}
        },
        series: [
            {
                name: 'count',
                type: 'bar',
                data: {{ exercise_topic_count }}
            }
        ]
    };

    option6 = {
        color: ['#636EFA'],
        title: {
            text: '各领域练习数量统计',
            textStyle: {
                color: '#5C768D',
                fontSize: 18,
                fontWeight: 400
            },
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {},
        grid: {
            left: '3%',
            right: '7%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            name: 'count',
            type: 'value',
            boundaryGap: [0, 0.01]
        },
        yAxis: {
            name: 'area',
            type: 'category',
            data: {{ exercise_area_index|safe }}
        },
        series: [
            {
                name: 'count',
                type: 'bar',
                data: {{ exercise_area_count }}
            }
        ]
    };

    option7 = {
        color: ['#636EFA'],
        title: {
            text: '各先决条件练习数量统计',
            textStyle: {
                color: '#5C768D',
                fontSize: 18,
                fontWeight: 400
            },
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {},
        grid: {
            left: '3%',
            right: '7%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            name: 'count',
            type: 'value',
            boundaryGap: [0, 0.01]
        },
        yAxis: {
            name: 'prerequisites',
            type: 'category',
            data: {{ exercise_prerequisites_index|safe }}
        },
        series: [
            {
                name: 'count',
                type: 'bar',
                data: {{ exercise_prerequisites_count }}
            }
        ]
    };

    // 图表配置
    var option8 = {
        chart: {
            type: 'scatter',
            zoomType: 'xy',
            backgroundColor: '#F5F9FC'
        },
        title: {
            text: 'Exercises distribution on area in knowledge map',
            backgroundColor: '#F5F9FC'
        },
        xAxis: {
            title: {
                enabled: true,
                text: 'v_position'
            },
            startOnTick: true,
            endOnTick: true,
            showLastLabel: true,
            backgroundColor: '#F5F9FC'
        },
        yAxis: {
            title: {
                text: 'h_position'
            },
            backgroundColor: '#F5F9FC'
        },
        legend: {
            layout: 'horizontal',
            align: 'left',
            verticalAlign: 'top',
            x: 150,
            y: 40,
            floating: true,
            backgroundColor: '#F5F9FC',
            borderWidth: 1
        },
        plotOptions: {
            scatter: {
                marker: {
                    radius: 3,
                    states: {
                        hover: {
                            enabled: true,
                            lineColor: 'rgb(100,100,100)'
                        }
                    }
                },
                states: {
                    hover: {
                        marker: {
                            enabled: false
                        }
                    }
                },
                tooltip: {
                    headerFormat: '<b>{series.name}</b><br>',
                    pointFormat: '({point.x} , {point.y} )'
                }
            }
        },
        series:{{ series_data|safe }}
    };
    var option9 = {
        chart: {
            type: 'scatter',
            zoomType: 'xy',
            backgroundColor: '#F5F9FC'
        },
        title: {
            text: 'Exercises distribution on topic in knowledge map',
            backgroundColor: '#F5F9FC'
        },
        xAxis: {
            title: {
                enabled: true,
                text: 'v_position',
                backgroundColor: '#F5F9FC'
            },
            startOnTick: true,
            endOnTick: true,
            showLastLabel: true
        },
        yAxis: {
            title: {
                text: 'h_position',
                backgroundColor: '#F5F9FC'
            },
        },
        legend: {
            layout: 'horizontal',
            align: 'left',
            verticalAlign: 'top',
            x: 150,
            y: 40,
            floating: true,
            backgroundColor: '#F5F9FC',
            borderWidth: 1
        },
        plotOptions: {
            scatter: {
                marker: {
                    radius: 3,
                    states: {
                        hover: {
                            enabled: true,
                            lineColor: 'rgb(100,100,100)'
                        }
                    }
                },
                states: {
                    hover: {
                        marker: {
                            enabled: false
                        }
                    }
                },
                tooltip: {
                    headerFormat: '<b>{series.name}</b><br>',
                    pointFormat: '({point.x} , {point.y} )'
                }
            }
        },
        series:{{ series_data_topic|safe }}
    };
    // 图表初始化函数
    var chart = Highcharts.chart('exercise_distribution_by_area', option8);
    var chart2 = Highcharts.chart('exercise_distribution_by_topic', option9);

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
    myChart2.setOption(option2);
    myChart3.setOption(option3);
    myChart4.setOption(option4);
    myChart5.setOption(option5);
    myChart6.setOption(option6);
    myChart7.setOption(option7);
</script>

<script>
    var btn1 = document.getElementById("btn1");
    var btn2 = document.getElementById("btn2");
    var btn3 = document.getElementById("btn3");
    var btn4 = document.getElementById("btn4");
    var btn5 = document.getElementById("btn5");
    var explanation1 = document.getElementById("explanation1");
    var explanation2 = document.getElementById("explanation2");
    var explanation3 = document.getElementById("explanation3");
    var explanation4 = document.getElementById("explanation4");
    var explanation5 = document.getElementById("explanation5");

    btn1.onclick = function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn1.value === "点击隐藏") {
            explanation1.classList.add("hide");
            btn1.value = "点击显示";
        } else {
            explanation1.classList.remove("hide");
            btn1.value = "点击隐藏";
        }
    };


    btn2.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn2.value === "点击隐藏") {
            explanation2.classList.add("hide");
            btn2.value = "点击显示";
        } else {
            explanation2.classList.remove("hide");
            btn2.value = "点击隐藏";
        }
    }, false);

    btn3.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn3.value === "点击隐藏") {
            explanation3.classList.add("hide");
            btn3.value = "点击显示";
        } else {
            explanation3.classList.remove("hide");
            btn3.value = "点击隐藏";
        }
    }, false);

    btn4.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn4.value === "点击隐藏") {
            explanation4.classList.add("hide");
            btn4.value = "点击显示";
        } else {
            explanation4.classList.remove("hide");
            btn4.value = "点击隐藏";
        }
    }, false);

    btn5.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn5.value === "点击隐藏") {
            explanation5.classList.add("hide");
            btn5.value = "点击显示";
        } else {
            explanation5.classList.remove("hide");
            btn5.value = "点击隐藏";
        }
    }, false);

</script>


</body>

</html>